<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>团购商城_我的团</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel=" stylesheet" href="${pageContext.request.contextPath}/resources/font-awesome-4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/team.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/title.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/footer.css">
</head>
<body>
<header>
    <h1 class='title'>
        <a href="javascript:history.go(-1)" style="font-size: 1.9em;" class="fa fa-angle-left "></a>
        团购商城</h1>
</header>
<nav class="topnav">
    <ul class="topul">
        <li><a class="select" href="${pageContext.request.contextPath}/login-user/my-group-list" target="_self">全部</a></li>
        <li><a href="${pageContext.request.contextPath}/login-user/my-group-opened" target="_self">已成团</a></li>
        <li><a href="${pageContext.request.contextPath}/login-user/my-group-opening" target="_self">拼团中</a></li>

    </ul>
</nav>

<div class="centerul">

    <!--第一个导航栏li水果餐饮所对的ul-->
    <ul>
        <c:forEach items="${joinedGroupList}" var="openTeam">
            <li onclick=turnHref('${pageContext.request.contextPath}/login-user/group?groupId='+"${openTeam.groupId}") >
                <img src="${pageContext.request.contextPath}/resources/images/${openTeam.imgAddress}">

                <div>
                    <h2>${openTeam.groupTitle}</h2>

                    <p>
                            ${openTeam.groupDetail}
                    </p>

                    <div>
                        <c:if test="${openTeam.groupState eq 1}">
                            <button>开团中</button>
                            <span class="fa fa-spinner fa-pulse"></span>
                            ￥
                            <button> ${openTeam.price}</button>
                            差:
                            <button>${openTeam.groupTargetNumber-openTeam.nowUserNumber}</button>

                            人
                        </c:if>
                        <c:if test="${openTeam.groupState eq 2}">
                            ￥
                            <button>${openTeam.price}</button>
                            <button>已成团</button>
                        </c:if>
                    </div>
                </div>

            </li>
        </c:forEach>
        <c:forEach items="${myGroupList}" var="teamlist">
            <li onclick=turnHref('${pageContext.request.contextPath}/login-user/group?groupId='+"${teamlist.groupId}") >
                <img src="${pageContext.request.contextPath}/resources/images/${teamlist.imgAddress}">

                <div>
                    <h2>${teamlist.groupTitle}</h2>

                    <p>
                            ${teamlist.groupDetail}
                    </p>

                    <div>
                        <c:if test="${teamlist.groupState eq 1}">
                            <button>开团中</button>
                            <span class="fa fa-spinner fa-pulse"></span>
                            ￥
                            <button> ${teamlist.price}</button>
                            差:
                            <button>${teamlist.groupTargetNumber-teamlist.nowUserNumber}</button>

                            人
                        </c:if>
                        <c:if test="${teamlist.groupState eq 2}">
                            ￥
                            <button>${teamlist.price}</button>
                            <button>以团中</button>
                        </c:if>
                    </div>
                </div>

            </li>
        </c:forEach>

    </ul>
</div>


<!--底部的三个按钮-->
<ul class="footer">
    <a href="${pageContext.request.contextPath}/login-user/index" target="_self">
        <li><span class="fa fa-home "></span><br>

            <p>首页</p></li>
    </a>
    <a href="${pageContext.request.contextPath}/login-user/my-group-list" target="_self">
        <li class="footerselect"><span class="fa fa-user-circle-o "></span><br>

            <p>我的团</p></li>
    </a>
    <a href="${pageContext.request.contextPath}/login-user/my-order-list" target="_self">
        <li><span class="fa fa-cart-plus "></span><br>

            <p>订单</p></li>
    </a>
</ul>
</body>
<script src="${pageContext.request.contextPath}/resources/js/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.mobile.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/myteam.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/footer.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/public.js"></script>
</html>